<?
    // [{name:"张三",hobby:['篮球','足球','乒乓球']},{name:"李四",hobby:['高尔夫','看书','敲代码']}]
    $arr2 = array(0=>array('name'=>"张三",'hobby'=>array('篮球','足球','乒乓球')),
    1=>array('name'=>'李四','hobby'=>array('高尔夫','看书','敲代码')));
    foreach( $arr2 as $value ){
        foreach( $value as $item ){
            $str = '' ;
            if( gettype($item) == 'array' ){
                // var_dump($item);
                foreach( $item as $v ){
                    $str .= $v ; 
                    // echo $v ;
                }
            }else{
                $str .= $item;
            }

            echo $str."<hr>";
           
        }
    }
    foreach( $arr2 as $key=>$value ){
        $str = '' ; 
        if(!empty($value['hobby'])){
            foreach( $value['hobby'] as $item ){
                $str .= $item ;  
            }
        }
        echo $value['name']."  ".$str."<br>"; 
    }
    // print_r(gettype(gettype($arr2)));
?>